<?php
//header("Content-type:text/html;charset=utf-8");

class Globals extends CI_Controller {

    public function __construct() {
        parent::__construct();
        $this->CI = & get_instance();
    }

    public function glob() {
        //变量可以在这里定义，或者来自配置文件，也可以去数据库中查     
        //$url_array = $this->CI->uri->segment_array();

        $variable = array();

        //重置模版页面
        $this->CI->load->set_view(array(APPPATH . 'views/cn/' => TRUE));

        //获取导航
        $this->CI->load->library('a_class',TRUE);
        $variable['g_nav_list'] = $this->CI->a_class->get_class_nav(CONFIG_ID);
        unset($this->CI);
        $this->CI = & get_instance();
        // 获取网站信息
        $this->CI->load->library('a_config',TRUE);
        $variable['g_site'] = $this->CI->a_config->get_config(CONFIG_ID);
        //获取友情链接
        unset($this->CI);
        $this->CI = & get_instance();
        $this->CI->load->library('a_link',TRUE);
        $variable['g_link'] = $this->CI->a_link->get_link_list_page(CONFIG_ID);

        unset($usc);
        $this->CI->load->vars($variable);

        $this->g_nav_list = $this->CI->load->get_var('g_nav_list');//获取导航
        $this->g_site = $this->CI->load->get_var('g_site');//获取网站信息
        $this->g_link = $this->CI->load->get_var('g_link');//获取友情链接

        //print_r($this->g_nav_list);

    }

}
